﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TradingServer.Core.Entities
{
    public class Trade : ICloneable
    {
        public Trade(Security security, decimal volume, decimal price)
        {
            Security = security;
            Volume = volume;
            Price = price;
        }

        public decimal Price { get; set; }
		public decimal TotalPrice { get { return Price * Volume; } }
        public decimal Volume { get; set; }
        public Security Security { get; set; }

        public Order SellOrder { get; set; }
        public Order BuyOrder { get; set; }

		public override string ToString()
		{
			return string.Format("Trade [ {0}, {1:0.00} ]", Security.Tiker, Price);
		}

		#region ICloneable Members

		public object Clone()
		{
			return this.MemberwiseClone();
		}

		#endregion
	}
}
